﻿<UserControl x:Class="SoftTeach.View.Noten.SchülereintragWorkspaceView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:softTeach="clr-namespace:SoftTeach" 
             xmlns:notenView="clr-namespace:SoftTeach.View.Noten"
             xmlns:notenViewModel="clr-namespace:SoftTeach.ViewModel.Noten"
             mc:Ignorable="d" 
             d:DesignHeight="400" d:DesignWidth="873">
  <Grid Background="{StaticResource DefaultOfficeBackgroundBrush}">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="250"/>
      <ColumnDefinition/>
    </Grid.ColumnDefinitions>
    <Grid Grid.Column="0">
      <Border Margin="10">
        <Grid>
          <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
          </Grid.RowDefinitions>
          <StackPanel Orientation="Horizontal"  Grid.Row="0" HorizontalAlignment="Center">
            <Label Content="Noten am" FontSize="18"/>
            <DatePicker SelectedDate="{Binding Path=CurrentSchülerliste.NotenDatum}" FontSize="18" VerticalAlignment="Center" Width="140"/>
          </StackPanel>
          <ComboBox Grid.Row="1" Margin="0,3" 
                    ItemsSource="{Binding Source={x:Static softTeach:App.MainViewModel}, Path=Schülerlisten}"
                    SelectedItem="{Binding Path=CurrentSchülerliste}"
                    DisplayMemberPath="SchülerlisteKurzbezeichnung"
                    Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}"
                    HorizontalAlignment="Stretch"/>
          <DataGrid Grid.Row="2" SelectedItem="{Binding Path=CurrentSchülereintrag, Mode=TwoWay}" ItemsSource="{Binding Path=CurrentSchülerliste.Schülereinträge}" AutoGenerateColumns="False" >
            <DataGrid.Columns>
              <DataGridTextColumn Header="Vorname" 
                                  Binding="{Binding Path=SchülereintragPerson.PersonVorname}"
                                  SortMemberPath="SchülereintragPerson.PersonVorname"/>
              <DataGridTextColumn Header="Nachname" 
                                  Binding="{Binding Path=SchülereintragPerson.PersonNachname}" 
                                  SortMemberPath="SchülereintragPerson.PersonNachname" 
                                  Width="*"/>
            </DataGrid.Columns>
          </DataGrid>
        </Grid>
      </Border>
    </Grid>
    <Grid Grid.Column="1" Margin="0,10,10,10">
      <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition Height="Auto"/>
          <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ToolBarTray Grid.Row="0" Orientation="Horizontal" IsLocked="True" Margin="0,0,0,3">
          <ToolBar Band="1" BandIndex="1">
            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddZeugnisnotenCommand}" ToolTip="Notenlisten anlegen oder Zeugnislisten machen.">
              <StackPanel Orientation="Horizontal">
                <Grid>
                  <Image Source="/SoftTeach;component/Images/Note32.png"/>
                </Grid>
                <Label Padding="5,0,0,0" VerticalContentAlignment="Center">Notenlisten anlegen und drucken</Label>
              </StackPanel>
            </Button>
            <Separator/>
            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddHausaufgabenCommand}" ToolTip="Nicht gemachte Hausaufgaben eintragen.">
              <StackPanel Orientation="Horizontal">
                <Grid>
                  <Image Source="/SoftTeach;component/Images/Hausaufgabe32.png"/>
                  <Image Source="/SoftTeach;component/Images/AddOverlay32.png"/>
                </Grid>
                <Label Padding="5,0,0,0" VerticalContentAlignment="Center">Nicht gemachte Hausaufgaben</Label>
              </StackPanel>
            </Button>
            <Button Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" Command="{Binding Path=AddSonstigeNotenCommand}" ToolTip="Sonstige Noten eintragen.">
              <StackPanel Orientation="Horizontal">
                <Grid>
                  <Image Source="/SoftTeach;component/Images/Note32.png"/>
                  <Image Source="/SoftTeach;component/Images/AddOverlay32.png"/>
                </Grid>
                <Label Padding="5,0,0,0" VerticalContentAlignment="Center">Sonstige Noten</Label>
              </StackPanel>
            </Button>
          </ToolBar>
        </ToolBarTray>
        <ContentControl Grid.Row="1" Content="{Binding Path=CurrentSchülereintrag}">
          <ContentControl.Resources>
            <DataTemplate DataType="{x:Type notenViewModel:SchülereintragViewModel}">
              <notenView:SchülereintragDetailView />
            </DataTemplate>
          </ContentControl.Resources>
        </ContentControl>
      </Grid>
    </Grid>
  </Grid>
</UserControl>
